let line = window.prompt("请输入生成表的行数:", "9");
/*循环*/
document.write("<table>")
document.write(`<caption>${line} x ${line}乘法表</caption>`)
for (let i = 1; i <= line; i++) {
    document.write("<tr>")
    for (let j = 1; j <= i; j++) {
        document.write("<td>")
        document.write(`${j}x${i}=${i * j}`);
        document.write("</td>")
    }
    document.writeln();
    document.write("<tr>")
}
document.write("</table>")